<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>{:session('cp.cpsysname')}--服务商管理平台</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
    <meta name="description" content="{:config('webconfig.description');}">
    <meta name="keywords" content="{:config('webconfig.keywords');}">
    <meta name="author" content="runoob">
    <link rel="stylesheet" href="__STATIC_URL__/static/bootstrap/3.3.7/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="__STATIC_URL__/static/css/index.css"/>
    <link rel="stylesheet" type="text/css" href="__STATIC_URL__/static/css/bootstrap-datetimepicker.css"/>
    <script src="__STATIC_URL__/static/jquery/2.2.1/jquery.min.js"></script>
    <script src="__STATIC_URL__/static/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <script src="__STATIC_URL__/static/js/commen.js" type="text/javascript" charset="utf-8"></script>
    <script src="__STATIC_URL__/static/js/bootstrap-datetimepicker.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
{include file='public/header'/}
<!------------------导航-------------------------->
<section>
    {include file='public/left'/}
    <!--------------------------主要内容区域------------------------------------->
    <div class="content">
        <div class="page-heading mgr15 mgl15">
            <ul class="breadcrumb">
                <li>
                    当前位置是&nbsp;:&nbsp;权限管理
                </li>
                <li class="active" style="color: #02b87f;"> 添加权限</li>
            </ul>
        </div>
        <div class="panel panel-default mgr15 mgl15">
            <div class="panel-heading">权限列表</div>
            <div class="panel-body">
                <form class="form-horizontal" role="form" method="post" active="">
                    <div class="form-group">
                        <label class="col-sm-1 control-label">用户组：</label>
                        <div class="col-sm-5">
                            <select class="input-sm m-bot15 col-sm-3" name="classes" id="classes">
                                <option value="">请选择类别</option>
                                <option value="1">系统管理员</option>
                                <option value="2">代理商</option>
                            </select>
                        </div>
                        <div class="text-right col-sm-6">
                            <button data-toggle="modal" data-target="#myModal" type="button" name="Cashier" method="post" action="" class="btn btn-info">添加用户组
                            </button>
                        </div>
                    </div>
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <h4 class="panel-title">权限分配</h4>
                        </div>
                        <div class="panel-body">
                            <table class="table table-bordered">
                                <tbody>
                                <volist name="rule" id="vo">
                                    <if condition="$vo['is_top'] eq 0">
                                        <tr>

                                            <td class="col-sm-2 mid">
                                                <input class="mgr15" type="checkbox" name="checkbox[]" id="check1" onclick="checkall('check1', 'checkbox1[]')" />商户管理
                                            </td>


                                            <td class="col-sm-10">
                                                <div class="col-sm-2">
                                                    <input class="mgr15" type="checkbox" name="checkbox1[]" onclick="checkall('check1', 'checkbox1[]')"/>添加商户
                                                </div>
                                                <div class="col-sm-2">
                                                    <input class="mgr15" type="checkbox" name="checkbox1[]" onclick="checkall('check1', 'checkbox1[]')"/>商户列表
                                                </div>
                                            </td>
                                        </tr>
                                    </if>
                                </volist>

                                </tbody>
                            </table>
                        </div>
                    </div>
                </form>
            </div>
        </div>
        {include file='public/footer'/}
    </div>
</section>
<!--添加用户组模态框-->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    &times;
                </button>
                <h4 class="modal-title" id="myModalLabel">添加用户组</h4>
            </div>
            <div class="modal-body">
                <form class="form-horizontal adminex-form" action="" method="post" id="sysuser"
                      enctype="multipart/form-data">
                    <div class="form-group" id="ferror1">
                        <label class="col-sm-3 col-sm-3 control-label">用户组别:</label>
                        <div class="col-sm-9">
                            <input type="text" class="form-control ipt4" id="usertype" name="usertype">
                            <div id="error1" class="error"></div>
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer" style="border-top: 0;">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭
                </button>
                <button type="button" class="btn btn-primary" id="tj" onclick="addform()">
                    提交
                </button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>
</body>

<script type="text/javascript">
    function checkall(id, checkname) {
        if (typeof $("#" + id) != "undefined") {
            $(document).on('click', '#' + id, function () {
                $("input[name='" + checkname + "']").prop("checked", this.checked);
            });
            $(document).on("click", "input[name='" + checkname + "']", function () {
                var $subs = $("input[name='" + checkname + "']");
                $("#" + id).prop("checked", $subs.filter(":checked").length > 0 ? true : false);
            });
        }
    }
    ;

</script>
</html>
